import App from './App'

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
  ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif

import uView from './uni_modules/uview-ui'
Vue.use(uView)

import common from './common/common'
Vue.prototype.$common = common;

import share from './common/share'
Vue.mixin(share);

import tabBar from "./components/tabbar/index";
Vue.component('tabBar',tabBar);

if(!uni.getStorageSync('token')){
  common.go(3,`/pages/login/index`);
}

import lang from './lang/index'
Vue.prototype.$lang = lang;

import store from './store'
Vue.prototype.$store=store;

Vue.prototype.$auth = uni.getStorageSync('userInfo').auth;
Vue.prototype.$menu = uni.getStorageSync('userInfo').menu;

// config
import configService from './common/config.service'
Vue.prototype.$config=configService;
